package com.example.demo.common;

import lombok.Data;

import java.util.List;

/**
 * @author guojing
 * @describe 通用返回数据
 * @dateTime 2018/1/11 17:40
 */
@Data
public class ResultVo<T> {

    /**
     * 状态
     */
    private Boolean retult = true;

    /**
     * 信息
     */
    private String message = "成功";
    /**
     * 错误信息
     */
    private List<Object> errMsg;
    /**
     * 默认成功
     */
    private long code = 1000;

    private T data;

    private String random;

    /**
     * 时间戳
     */
    Long timesTap = System.currentTimeMillis();

    public static final ResultVo RESULT_VO = new ResultVo();
    public static final ResultVo DEFAULT_ERROR_VO = new ResultVo() {{
        setMessage("业务处理失败");
        setRetult(false);
    }};
}